package com.smh.a05ObjectClassDemo5;

public class IntegerDemo {
    public static void main(String[] args) {

        //已废除
        Integer i = new Integer(10);
        Integer i2 = new Integer("12");
        System.out.println(i+","+i2);

        //jdk5之前
        Integer i1 = Integer.valueOf(123);
        System.out.println(i1);
        Integer i3 = Integer.valueOf("12321");
        System.out.println(i3);
        Integer i4 = Integer.valueOf("12", 8);
        System.out.println(i4);//转化为8进制
        //

        //-128~127会事先创建好
        Integer i6 = Integer.valueOf(127);
        Integer i5 = Integer.valueOf(127);
        System.out.println(i6==i5);

        Integer i9 = Integer.valueOf(128);
        Integer i10 = Integer.valueOf(128);
        System.out.println(i9==i10);

        Integer i7 = new Integer(12);
        Integer i8 = new Integer(12);
        System.out.println(i7==i8);

    }
}
